/*
 * @Author: your name
 * @Date: 2021-10-21 13:33:58
 * @LastEditTime: 2021-10-21 13:50:10
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Vuec:\Users\86131\Desktop\project\payforknowledge\src\store\detail\index.js
 */

import { detailApi } from "../../utils/api";

const detailModule = {
  state: {
    detailData: [],
  },

  mutations: {
    changeDetail(state, payload) {
      state.detailData = payload.result;
    },
  },

  actions: {
    async getDetailData({ commit }, payload) {
      const res = await detailApi({
        id: payload.id,
      });

      commit("changeDetail", res);
    },
  },
};

export default detailModule;
